﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PASNew.UserControls
{
    public partial class NavigationUC : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserIdentity"] == null)
            {
                lbLogInOut.Text = "LOGIN";
                lbLogInOut.ToolTip = "LOGIN";

                lbAdmin.Visible = false;
                lbClients.Visible = false;
                lbNotifications.Visible = false;
            }
            else
            {
                lbLogInOut.Text = "LOGOUT";
                lbLogInOut.ToolTip = "LOGOUT";

                lbAdmin.Visible = true;
                lbClients.Visible = true;
                lbNotifications.Visible = true;
            }
        }

        protected void lbHome_Click(object sender, EventArgs e)
        {
            Response.Redirect("Home.aspx");
        }

        protected void lbNotifications_Click(object sender, EventArgs e)
        {
            Response.Redirect("Notifications.aspx");
        }

        protected void lbClients_Click(object sender, EventArgs e)
        {
            Response.Redirect("Clients.aspx");
        }

        protected void lbAdmin_Click(object sender, EventArgs e)
        {
            Response.Redirect("Admin.aspx");
        }

        protected void lbAbout_Click(object sender, EventArgs e)
        {
            Response.Redirect("About.aspx");
        }

        protected void lbContact_Click(object sender, EventArgs e)
        {
            Response.Redirect("Contact.aspx");
        }

        protected void lbLogInOut_Click(object sender, EventArgs e)
        {
            if (Session["UserIdentity"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                Session.Clear();
                Response.Redirect("Home.aspx");
            }
        }
    }
}